<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,IE=9,chrome=1"><meta name="generator" content="MATLAB 2021a"><title>Creating a Model </title><style type="text/css">.rtcContent { padding: 30px; } .S0 { margin: 3px 10px 5px 4px; padding: 0px; line-height: 28.8px; min-height: 0px; white-space: pre-wrap; color: rgb(213, 80, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 24px; font-weight: normal; text-align: left;  }
.S1 { margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(60, 60, 60); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;  }
.S2 { margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: normal; text-align: left;  }
.CodeBlock { background-color: #F7F7F7; margin: 10px 0 10px 0;}
.S3 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 1px solid rgb(233, 233, 233); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S4 { color: rgb(64, 64, 64); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;  }
/* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 250px;    overflow: auto;}
.embeddedOutputsErrorElement.inlineElement {}
.embeddedOutputsErrorElement.rightPaneElement {}
/* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsWarningElement{    min-height: 18px;    max-height: 250px;    overflow: auto;}
.embeddedOutputsWarningElement.inlineElement {}
.embeddedOutputsWarningElement.rightPaneElement {}
/* Copyright 2015-2019 The MathWorks, Inc. *//* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip */.diagnosticMessage-wrapper {    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;    font-size: 12px;}
.diagnosticMessage-wrapper.diagnosticMessage-warningType {    color: rgb(255,100,0);}
.diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: rgb(255,100,0);    text-decoration: underline;}
.diagnosticMessage-wrapper.diagnosticMessage-errorType {    color: rgb(230,0,0);}
.diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: rgb(230,0,0);    text-decoration: underline;}
.diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: pre-wrap;}
.diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: pre;}
.embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: pre;    word-wrap:  initial;    min-height: 18px;    max-height: 250px;    overflow: auto;}
.textElement,.rtcDataTipElement .textElement {    padding-top: 3px;}
.embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {}
.inlineElement .textElement {}
.embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;}
.rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;}
.S5 { margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: normal; text-align: left;  }
.S6 { margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: normal; text-align: center;  }
.S7 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 1px solid rgb(233, 233, 233); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 0px; padding: 6px 45px 4px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S8 { margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px;  }
.S9 { margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;  }
.S10 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 1px solid rgb(233, 233, 233); border-bottom: 0px none rgb(0, 0, 0); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S11 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 0px none rgb(0, 0, 0); border-bottom: 0px none rgb(0, 0, 0); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S12 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 0px none rgb(0, 0, 0); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S13 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 0px none rgb(0, 0, 0); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }</style></head><body><div class = rtcContent><h1  class = 'S0'><span>Creating a Model </span></h1><h2  class = 'S1'><span>Author(s): Thomas Pfau, University of Luxembourg</span></h2><h2  class = 'S1'><span>Reviewer(s):</span></h2><h2  class = 'S1'><span>INTRODUCTION</span></h2><div  class = 'S2'><span>This tutorial explains the most basic functions provided by The COBRA Toolbox  to create a model from scratch (i.e. define all relevant reactions and build a model from them). </span></div><h2  class = 'S1'><span>MATERIALS</span></h2><div  class = 'S2'><span>In this tutorial, two models are created: a small toy model and a simple model of glycolysis. The latter is also used in the model manipulation tutorial.</span></div><h2  class = 'S1'><span>PROCEDURE</span></h2><div  class = 'S2'><span style=' font-weight: bold;'>1. Create a simple toy model</span></div><div  class = 'S2'><span>To create a new model, there is a simple function </span><span style=' font-family: monospace;'>createModel</span><span>:</span></div><div class="CodeBlock"><div class="inlineWrapper outputs"><div  class = 'S3'><span style="white-space: pre"><span >emptymodel = createModel()</span></span></div><div  class = 'S4'><div class="inlineElement eoOutputWrapper embeddedOutputsVariableStringElement" uid="29959FCC" data-testid="output_0" data-width="428" data-height="188" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><span class="variableNameElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">emptymodel = </span></div><div style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">          rxns: {0×1 cell}
             S: []
            lb: [0×1 double]
            ub: [0×1 double]
             c: [0×1 double]
          mets: {0×1 cell}
             b: [0×1 double]
         rules: {0×1 cell}
         genes: {0×1 cell}
        osense: -1
        csense: ''
    rxnGeneMat: []
</div></div></div></div></div></div><div  class = 'S5'><span>Calling it as above, yields an empty model </span><span style=' font-family: monospace;'>struct</span><span> with all required fields defined. To add reactions or metabolites please have a look at the tutorial for model manipulation.</span></div><div  class = 'S2'><span>There is also a possibility to immediately create a model with multiple reactions using </span><span style=' font-family: monospace;'>createModel</span><span>. To do so, a list of reaction identifiers, reaction names and reaction formulas has to be supplied.</span></div><div  class = 'S2'><span>Let's consider the following toy model:</span></div><div  class = 'S6'><img class = "imageNode" src = "" alt = "" style = "vertical-align: baseline"></img></div><div  class = 'S2'><span>The reactions are:</span></div><div class="CodeBlock"><div class="inlineWrapper outputs"><div  class = 'S3'><span style="white-space: pre"><span >R1 = </span><span style="color: rgb(170, 4, 249);">'1 Met1 + Met2 -&gt; Met3'</span></span></div><div  class = 'S4'><div class="inlineElement eoOutputWrapper embeddedOutputsVariableStringElement" uid="8233C90F" data-testid="output_1" data-width="428" data-height="20" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><span class="variableNameElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">R1 = </span>1 Met1 + Met2 -&gt; Met3</div></div></div></div></div><div class="inlineWrapper outputs"><div  class = 'S7'><span style="white-space: pre"><span >R2 = </span><span style="color: rgb(170, 4, 249);">'Met3 &lt;=&gt; 2 Met4'</span></span></div><div  class = 'S4'><div class="inlineElement eoOutputWrapper embeddedOutputsVariableStringElement" uid="B32591E4" data-testid="output_2" data-width="428" data-height="20" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><span class="variableNameElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">R2 = </span>Met3 &lt;=&gt; 2 Met4</div></div></div></div></div></div><div  class = 'S5'><span>Reaction formulas are given as metabolites and their stoichiometric coefficient concatenated by +. Products and substrates are separated by a reversibility indicator, with </span><span style=' font-family: monospace;'>-&gt;</span><span> indicating an irreversible reaction and </span><span style=' font-family: monospace;'>&lt;=&gt;</span><span> indicating a reversible reaction.</span></div><div  class = 'S2'><span>To be able to use </span><span style=' font-family: monospace;'>createModel</span><span> to build this model, we also have to define the reaction Identifiers and the reaction names:</span></div><div class="CodeBlock"><div class="inlineWrapper outputs"><div  class = 'S3'><span style="white-space: pre"><span >reactionIdentifiers = {</span><span style="color: rgb(170, 4, 249);">'R1'</span><span >, </span><span style="color: rgb(170, 4, 249);">'R2'</span><span >}</span></span></div><div  class = 'S4'><div class="inlineElement eoOutputWrapper embeddedOutputsVariableStringElement" uid="97ADB46C" data-testid="output_3" data-width="428" data-height="34" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><span class="variableNameElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">reactionIdentifiers = </span></div><div style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">    'R1'    'R2'
</div></div></div></div></div><div class="inlineWrapper outputs"><div  class = 'S7'><span style="white-space: pre"><span >reactionNames = {</span><span style="color: rgb(170, 4, 249);">'Reaction 1'</span><span >, </span><span style="color: rgb(170, 4, 249);">'Reaction 2'</span><span >}</span></span></div><div  class = 'S4'><div class="inlineElement eoOutputWrapper embeddedOutputsVariableStringElement" uid="F8421094" data-testid="output_4" data-width="428" data-height="34" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><span class="variableNameElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">reactionNames = </span></div><div style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">    'Reaction 1'    'Reaction 2'
</div></div></div></div></div></div><div  class = 'S5'><span>And we have to combine the reactions:</span></div><div class="CodeBlock"><div class="inlineWrapper outputs"><div  class = 'S3'><span style="white-space: pre"><span >reactionFormulas = {R1, R2}</span></span></div><div  class = 'S4'><div class="inlineElement eoOutputWrapper embeddedOutputsVariableStringElement" uid="9A48258A" data-testid="output_5" data-width="428" data-height="34" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><span class="variableNameElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">reactionFormulas = </span></div><div style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">    '1 Met1 + Met2 -&gt; Met3'    'Met3 &lt;=&gt; 2 Met4'
</div></div></div></div></div></div><div  class = 'S2'><span>now we can call</span></div><div class="CodeBlock"><div class="inlineWrapper outputs"><div  class = 'S3'><span style="white-space: pre"><span >model1 = createModel(reactionIdentifiers, reactionNames, reactionFormulas);</span></span></div><div  class = 'S4'><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="32C9B139" data-testid="output_6" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Metabolite Met1[c] not in model - added to the model</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="4AE5C2CE" data-testid="output_7" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Metabolite Met2[c] not in model - added to the model</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="2AEE50A4" data-testid="output_8" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Metabolite Met3[c] not in model - added to the model</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="40CB9CC8" data-testid="output_9" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">R1	Met1[c] + Met2[c] 	&lt;=&gt;	Met3[c] </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="0E934F69" data-testid="output_10" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Metabolite Met4[c] not in model - added to the model</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="E05AE4A8" data-testid="output_11" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">R2	Met3[c] 	&lt;=&gt;	2 Met4[c] </div></div></div></div></div><div  class = 'S5'><span>to create the model including the two reactions. </span></div><div  class = 'S2'><span style=' font-weight: bold;'>2. Explanation of options for the createModel function</span></div><div  class = 'S2'><span style=' font-family: monospace;'>createModel</span><span> offers a couple of additional optional parameters. Those include:</span></div><ul  class = 'S8'><li  class = 'S9'><span style=' font-family: monospace;'>revFlagList</span><span> - a double array of indications whether the reaction is reversible or not this will overwrite the indicator from the formula. (default: 1 for reversible formulas, 0 for irreversible formulas)</span></li><li  class = 'S9'><span style=' font-family: monospace;'>lowerBoundList</span><span> - a double array indicating the lower bounds of the providing reactions (again, this will overwrite both </span><span style=' font-family: monospace;'>revFlagList</span><span> and the indication from the formula). E.g. if a </span><span style=' font-family: monospace;'>revFlagList</span><span> entry indicates a reversible reaction, but the lower bound is &gt;0, the reaction will be considered as irreversible. (The default is to assume 0 for irreversible and 1000 for reversible reactions)</span></li><li  class = 'S9'><span style=' font-family: monospace;'>upperBoundList</span><span> - a double array indicating the upper bounds of the reactions. (default: 1000)</span></li><li  class = 'S9'><span style=' font-family: monospace;'>subSystemList</span><span> - a cell array indicating the subSystems of the reactions</span></li><li  class = 'S9'><span style=' font-family: monospace;'>grRuleList</span><span> - a cell array indicating the GPR rules for a formula (in textual format e.g. Gene1 and Gene2)</span></li><li  class = 'S9'><span style=' font-family: monospace;'>geneNameList</span><span> - a List of genes present in the </span><span style=' font-family: monospace;'>grRuleList</span><span> array</span></li><li  class = 'S9'><span style=' font-family: monospace;'>systNameList</span><span> - a List (of equal size as </span><span style=' font-family: monospace;'>geneNameList</span><span>), that is used to translate the genes from those used in the </span><span style=' font-family: monospace;'>geneNameList</span><span> to those used in this list. </span></li></ul><div  class = 'S2'><span style=' font-weight: bold;'>3. Creating a model with Gene-Protein-Reaction Association (GPR) rules</span></div><div  class = 'S2'><span>Let's assume, our network has the following GPR associations:</span></div><div  class = 'S6'><img class = "imageNode" src = "" alt = "" style = "vertical-align: baseline"></img></div><div  class = 'S2'><span>i.e. a complex of G1 and G2 catalyses R2 and either G3 or G4 catalyse R1. We further assume, that the flux maximum through R1 is 10 and 30 through R2</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S10'><span style="white-space: pre"><span >upperBounds = [10, 30];</span></span></div></div><div class="inlineWrapper"><div  class = 'S11'><span style="white-space: pre"><span >grRuleR1 = </span><span style="color: rgb(170, 4, 249);">'G3 or G4'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S11'><span style="white-space: pre"><span >grRuleR2 = </span><span style="color: rgb(170, 4, 249);">'G1 and G2'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S12'><span style="white-space: pre"><span >grRuleList = {grRuleR1, grRuleR2};</span></span></div></div></div><div  class = 'S5'><span>The model creation call would then be:</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S10'><span style="white-space: pre"><span >model2 = createModel(reactionIdentifiers, reactionNames, reactionFormulas, </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S13'><span style="white-space: pre"><span >                     </span><span style="color: rgb(170, 4, 249);">'upperBoundList'</span><span >, upperBounds, </span><span style="color: rgb(170, 4, 249);">'grRuleList'</span><span >, grRuleList);</span></span></div><div  class = 'S4'><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="1A9B420D" data-testid="output_12" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Metabolite Met1[c] not in model - added to the model</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="7FA38034" data-testid="output_13" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Metabolite Met2[c] not in model - added to the model</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="54EA4B43" data-testid="output_14" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Metabolite Met3[c] not in model - added to the model</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="1D815072" data-testid="output_15" data-width="428" data-height="45" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">New gene G3 added to model
New gene G4 added to model
R1	Met1[c] + Met2[c] 	&lt;=&gt;	Met3[c] </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="842EA769" data-testid="output_16" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Metabolite Met4[c] not in model - added to the model</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="63DB93F5" data-testid="output_17" data-width="428" data-height="45" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">New gene G1 added to model
New gene G2 added to model
R2	Met3[c] 	&lt;=&gt;	2 Met4[c] </div></div></div></div></div><div  class = 'S2'><span>If we now compare the reactions, printing the GPR rules in both models</span></div><div class="CodeBlock"><div class="inlineWrapper outputs"><div  class = 'S3'><span style="white-space: pre"><span >printRxnFormula(model1, </span><span style="color: rgb(170, 4, 249);">'gprFlag'</span><span >, 1);</span></span></div><div  class = 'S4'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="FEC9D1E2" data-testid="output_18" data-width="428" data-height="31" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">R1	Met1[c] + Met2[c] 	&lt;=&gt;	Met3[c] 	
R2	Met3[c] 	&lt;=&gt;	2 Met4[c] 	</div></div></div></div><div class="inlineWrapper outputs"><div  class = 'S7'><span style="white-space: pre"><span >printRxnFormula(model2, </span><span style="color: rgb(170, 4, 249);">'gprFlag'</span><span >, 1);</span></span></div><div  class = 'S4'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="5FDB1589" data-testid="output_19" data-width="428" data-height="31" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">R1	Met1[c] + Met2[c] 	&lt;=&gt;	Met3[c] 	G3 or G4
R2	Met3[c] 	&lt;=&gt;	2 Met4[c] 	G1 and G2</div></div></div></div></div><div  class = 'S5'><span>we see, that </span><span style=' font-family: monospace;'>model2</span><span> has assigned GPR rules, while </span><span style=' font-family: monospace;'>model1</span><span> does not have those.</span></div><div  class = 'S2'><span style=' font-weight: bold;'>4. Create a model of the upper part of glycolysis</span></div><div  class = 'S2'><span>We will now create a slightly more complex model (essentially, the upper part of the glycolysis) which will be used in other tutorials (e.g. ModelManipulation)</span></div><div  class = 'S6'><img class = "imageNode" src = "" width = "620" height = "161" alt = "" style = "vertical-align: baseline"></img></div><div  class = 'S2'><span>To create this model, we have to define the reactions:</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S10'><span style="white-space: pre"><span >reactionFormulas = {</span><span style="color: rgb(170, 4, 249);">'glc-D[e]  -&gt; glc-D'</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  class = 'S11'><span style="white-space: pre"><span >    </span><span style="color: rgb(170, 4, 249);">'glc-D + atp  -&gt; H + adp + g6p'</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  class = 'S11'><span style="white-space: pre"><span >    </span><span style="color: rgb(170, 4, 249);">'g6p  &lt;=&gt; f6p'</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  class = 'S11'><span style="white-space: pre"><span >    </span><span style="color: rgb(170, 4, 249);">'atp + f6p  -&gt; H + adp + fdp'</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  class = 'S11'><span style="white-space: pre"><span >    </span><span style="color: rgb(170, 4, 249);">'fdp + h2o  -&gt; f6p + pi'</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  class = 'S11'><span style="white-space: pre"><span >    </span><span style="color: rgb(170, 4, 249);">'fdp  -&gt; g3p + dhap'</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  class = 'S11'><span style="white-space: pre"><span >    </span><span style="color: rgb(170, 4, 249);">'dhap  -&gt; g3p'</span><span >};</span></span></div></div><div class="inlineWrapper"><div  class = 'S11'><span style="white-space: pre"><span >reactionNames = {</span><span style="color: rgb(170, 4, 249);">'GLCt1'</span><span >, </span><span style="color: rgb(170, 4, 249);">'HEX1'</span><span >, </span><span style="color: rgb(170, 4, 249);">'PGI'</span><span >, </span><span style="color: rgb(170, 4, 249);">'PFK'</span><span >, </span><span style="color: rgb(170, 4, 249);">'FBP'</span><span >, </span><span style="color: rgb(170, 4, 249);">'FBA'</span><span >, </span><span style="color: rgb(170, 4, 249);">'TPI'</span><span >};</span></span></div></div><div class="inlineWrapper"><div  class = 'S11'><span style="white-space: pre"><span >lowerBounds = [-20, 0, -20, 0, 0, -20, -20];</span></span></div></div><div class="inlineWrapper"><div  class = 'S11'><span style="white-space: pre"><span >upperBounds = [20, 20, 20, 20, 20, 20, 20];</span></span></div></div><div class="inlineWrapper"><div  class = 'S11'><span style="white-space: pre"><span >glycolysisModel = createModel(reactionNames, reactionNames, reactionFormulas,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S13'><span style="white-space: pre"><span >                             </span><span style="color: rgb(170, 4, 249);">'lowerBoundList'</span><span >, lowerBounds, </span><span style="color: rgb(170, 4, 249);">'upperBoundList'</span><span >, upperBounds);</span></span></div><div  class = 'S4'><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="778D670A" data-testid="output_20" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Metabolite glc-D[e] not in model - added to the model</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="65F66BCB" data-testid="output_21" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Metabolite glc-D[c] not in model - added to the model</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="8EFBA080" data-testid="output_22" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">GLCt1	glc-D[e] 	&lt;=&gt;	glc-D[c] </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="E5325CA5" data-testid="output_23" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Metabolite atp[c] not in model - added to the model</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="98C7696F" data-testid="output_24" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Metabolite H[c] not in model - added to the model</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="BD79A375" data-testid="output_25" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Metabolite adp[c] not in model - added to the model</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="8377F70D" data-testid="output_26" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Metabolite g6p[c] not in model - added to the model</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="5FC371E4" data-testid="output_27" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">HEX1	glc-D[c] + atp[c] 	-&gt;	H[c] + adp[c] + g6p[c] </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="F9AE5BE9" data-testid="output_28" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Metabolite f6p[c] not in model - added to the model</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="64453024" data-testid="output_29" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">PGI	g6p[c] 	&lt;=&gt;	f6p[c] </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="4FFCED75" data-testid="output_30" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Metabolite fdp[c] not in model - added to the model</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="00BAD9FF" data-testid="output_31" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">PFK	atp[c] + f6p[c] 	-&gt;	H[c] + adp[c] + fdp[c] </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="C67A2A1F" data-testid="output_32" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Metabolite h2o[c] not in model - added to the model</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="39A6F2AF" data-testid="output_33" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Metabolite pi[c] not in model - added to the model</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="396C813B" data-testid="output_34" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">FBP	fdp[c] + h2o[c] 	-&gt;	f6p[c] + pi[c] </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="0877D3C0" data-testid="output_35" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Metabolite g3p[c] not in model - added to the model</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="5B0617FE" data-testid="output_36" data-width="428" data-height="18" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: pre-wrap; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Metabolite dhap[c] not in model - added to the model</div><div class="diagnosticMessage-stackPart" style="white-space: pre; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="FA3F8D5C" data-testid="output_37" data-width="428" data-height="31" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px; white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: pre; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">FBA	fdp[c] 	&lt;=&gt;	g3p[c] + dhap[c] 
TPI	dhap[c] 	&lt;=&gt;	g3p[c] </div></div></div></div></div><div  class = 'S2'></div>
<br>
<!-- 
##### SOURCE BEGIN #####
%% Creating a Model 
%% Author(s): Thomas Pfau, University of Luxembourg
%% Reviewer(s):
%% INTRODUCTION
% This tutorial explains the most basic functions provided by The COBRA Toolbox  
% to create a model from scratch (i.e. define all relevant reactions and build 
% a model from them). 
%% MATERIALS
% In this tutorial, two models are created: a small toy model and a simple model 
% of glycolysis. The latter is also used in the model manipulation tutorial.
%% PROCEDURE
% *1. Create a simple toy model*
% 
% To create a new model, there is a simple function |createModel|:

emptymodel = createModel()
%% 
% Calling it as above, yields an empty model |struct| with all required fields 
% defined. To add reactions or metabolites please have a look at the tutorial 
% for model manipulation.
% 
% There is also a possibility to immediately create a model with multiple reactions 
% using |createModel|. To do so, a list of reaction identifiers, reaction names 
% and reaction formulas has to be supplied.
% 
% Let's consider the following toy model:
% 
% 
%% 
% The reactions are:

R1 = '1 Met1 + Met2 -> Met3'
R2 = 'Met3 <=> 2 Met4'
%% 
% Reaction formulas are given as metabolites and their stoichiometric coefficient 
% concatenated by +. Products and substrates are separated by a reversibility 
% indicator, with |->| indicating an irreversible reaction and |<=>| indicating 
% a reversible reaction.
% 
% To be able to use |createModel| to build this model, we also have to define 
% the reaction Identifiers and the reaction names:

reactionIdentifiers = {'R1', 'R2'}
reactionNames = {'Reaction 1', 'Reaction 2'}
%% 
% And we have to combine the reactions:

reactionFormulas = {R1, R2}
%% 
% now we can call

model1 = createModel(reactionIdentifiers, reactionNames, reactionFormulas);
%% 
% to create the model including the two reactions. 
%% 
% *2. Explanation of options for the createModel function*
% 
% |createModel| offers a couple of additional optional parameters. Those include:
%% 
% * |revFlagList| - a double array of indications whether the reaction is reversible 
% or not this will overwrite the indicator from the formula. (default: 1 for reversible 
% formulas, 0 for irreversible formulas)
% * |lowerBoundList| - a double array indicating the lower bounds of the providing 
% reactions (again, this will overwrite both |revFlagList| and the indication 
% from the formula). E.g. if a |revFlagList| entry indicates a reversible reaction, 
% but the lower bound is >0, the reaction will be considered as irreversible. 
% (The default is to assume 0 for irreversible and 1000 for reversible reactions)
% * |upperBoundList| - a double array indicating the upper bounds of the reactions. 
% (default: 1000)
% * |subSystemList| - a cell array indicating the subSystems of the reactions
% * |grRuleList| - a cell array indicating the GPR rules for a formula (in textual 
% format e.g. Gene1 and Gene2)
% * |geneNameList| - a List of genes present in the |grRuleList| array
% * |systNameList| - a List (of equal size as |geneNameList|), that is used 
% to translate the genes from those used in the |geneNameList| to those used in 
% this list. 
%% 
% *3. Creating a model with Gene-Protein-Reaction Association (GPR) rules*
% 
% Let's assume, our network has the following GPR associations:
% 
% 
% 
% i.e. a complex of G1 and G2 catalyses R2 and either G3 or G4 catalyse R1. 
% We further assume, that the flux maximum through R1 is 10 and 30 through R2

upperBounds = [10, 30];
grRuleR1 = 'G3 or G4';
grRuleR2 = 'G1 and G2';
grRuleList = {grRuleR1, grRuleR2};
%% 
% The model creation call would then be:

model2 = createModel(reactionIdentifiers, reactionNames, reactionFormulas, ...
                     'upperBoundList', upperBounds, 'grRuleList', grRuleList);
%% 
% If we now compare the reactions, printing the GPR rules in both models

printRxnFormula(model1, 'gprFlag', 1);
printRxnFormula(model2, 'gprFlag', 1);
%% 
% we see, that |model2| has assigned GPR rules, while |model1| does not have 
% those.
%% 
% *4. Create a model of the upper part of glycolysis*
% 
% We will now create a slightly more complex model (essentially, the upper part 
% of the glycolysis) which will be used in other tutorials (e.g. ModelManipulation)
% 
% 
% 
% To create this model, we have to define the reactions:

reactionFormulas = {'glc-D[e]  -> glc-D',...
    'glc-D + atp  -> H + adp + g6p',...
    'g6p  <=> f6p',...
    'atp + f6p  -> H + adp + fdp',...
    'fdp + h2o  -> f6p + pi',...
    'fdp  -> g3p + dhap',...
    'dhap  -> g3p'};
reactionNames = {'GLCt1', 'HEX1', 'PGI', 'PFK', 'FBP', 'FBA', 'TPI'};
lowerBounds = [-20, 0, -20, 0, 0, -20, -20];
upperBounds = [20, 20, 20, 20, 20, 20, 20];
glycolysisModel = createModel(reactionNames, reactionNames, reactionFormulas,...
                             'lowerBoundList', lowerBounds, 'upperBoundList', upperBounds);
%% 
%
##### SOURCE END #####
-->
</div></body></html>